package uk.dier.account.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import uk.dier.account.dao.ISProductDao;
import uk.dier.account.dto.ProductDto;
import uk.dier.account.entity.Product;
import uk.dier.account.exception.ExceptionDao;
import uk.dier.account.exception.ExceptionService;
import uk.dier.account.service.ISProductService;

public class ProductSerciveImpl implements ISProductService {

	@Autowired
	private ISProductDao productDao;
	
	public void saveProduct(Product newProduct) throws ExceptionService, ExceptionDao {
		productDao.saveProduct(newProduct);
	}

	public void deleteProduct(Product removeProduct) throws ExceptionService, ExceptionDao {
		productDao.deleteProduct(removeProduct);
	}

	public void updateProduct(Product updateProduct) throws ExceptionService, ExceptionDao {
		productDao.updateProduct(updateProduct);
	}

	public List<ProductDto> findProductByName(Product product) throws ExceptionService, ExceptionDao {
		return productDao.findProducttByName(product);
	}

	public void setProductDao(ISProductDao productDao) {
		this.productDao = productDao;
	}

}
